#include "trap.h"
   .globl main
   .text
main:
   # div
   li $v0, 0xfffffffe
   li $v1, 0xffffffda
   li $t0, 0xfffffce0 # -800
   li $t1, 0x00000015 # 21
   div $zero, $t0, $t1 
   mfhi $t0 # 0xfffffffe -2
   mflo $t1 # 0xffffffda -38
   nop
   bne $v0, $t0, error
   bne $v1, $t1, error
   
   # divu
   li $v0, 0x00000016
   li $v1, 0x06d44fdf
   li $t0, 0xaabbccdd
   li $t1, 0x00000019
   divu $zero, $t0, $t1
   mfhi $t0 # 0x00000016
   mflo $t1 # 0x06d44fdf
   nop
   bne $v0, $t0, error
   bne $v1, $t1, error
   li $t2, 0x12345678
   HIT_GOOD_TRAP		# stop temu

error:
   j error


   